//
//  WaterCameraViewManager.m
//  yuanduo_app
//
//  Created by ZekiMini on 2021/7/28.
//

#import "WaterCameraViewManager.h"
#import "WaterCameraView.h"

@interface WaterCameraViewManager ()
@property (nonatomic, strong)WaterCameraView *waterView;
@end

@implementation WaterCameraViewManager
//标记宏
RCT_EXPORT_MODULE()


- (UIView *)view{
  if (!self.waterView) {
    self.waterView = [[WaterCameraView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
  }
  
  return self.waterView;
}



#pragma mark -- method

RCT_EXPORT_METHOD(onCreate:(nonnull NSNumber *)reactTag){
  
}
RCT_EXPORT_METHOD(onDestroy:(nonnull NSNumber *)reactTag){
  dispatch_async(dispatch_get_main_queue(), ^{
    [self.waterView distoaryView];
    self.waterView = nil;
  });
}
RCT_EXPORT_METHOD(receiveCarNum:(nonnull NSNumber *)reactTag data:(NSString *)carNum){
  dispatch_async(dispatch_get_main_queue(), ^{
    [self.waterView licensePlateText: [carNum gj_hasValue] ? carNum : @"" ];
  });
}


#pragma mark -- property

@end
